﻿using System;
using _5E.Infrastructure.Configuration;

namespace WholesaleOnline.Infrastructure.Configuration
{
    public class MyApplicationSettingsFactory
    {
        private static IMyApplicationSettings s_ApplicationSettings = null;
        public static IMyApplicationSettings ApplicationSettings
        {
            get
            {
                if (null == s_ApplicationSettings)
                    throw new ArgumentNullException("未设置ApplicationSettings属性!");
                return s_ApplicationSettings;
            }
        }

        public static void InitializeApplicationSettingsFactory(IMyApplicationSettings applicationSettings)
        {
            s_ApplicationSettings = applicationSettings;
            ApplicationSettingsFactory.InitializeApplicationSettingsFactory(applicationSettings);
        }        
    }
}
